﻿package src.uipackage.ui.events {
	
	import flash.events.Event;
	import src.MotifMatches;
	
	/**
	* Event dispatched by OBO_EyeDropper and OBO_ColorPicker classes
	* @author Devon O.
	* Modified by Indrek Tamming
	*/
	public class ColorEvent extends Event {
		
		private var _color:uint;
		private var _colorString:String;
		
		private var _matches:MotifMatches
		
		public static const COLOR_SELECT:String = "onColorSelect";
		
		public function ColorEvent(type:String, color:uint, colorString:String, matches:MotifMatches = null):void {
			super (type);
			_color = color;
			_colorString = colorString;
			_matches = matches;
		}
		
		public override function clone():Event {
			return new ColorEvent(type, _color, _colorString);
		}
		
		/**
		 * Returns the decimal value of the selected color.
		 */
		public function get color():uint { return _color; }

		/**
		 * Returns the hexadecimal value of the selected color in String form.
		 */
		public function get colorString():String { return _colorString; }
		
		public function get matches():MotifMatches { return _matches; }
		
	}	
}